#!/bin/bash
#1. install jupyter
apt install python3
apt install pyhton3-pip
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
apt install jupyter
jupyter notebook --generate-config --allow-root

#2. config remote mode
echo "c.NotebookApp.ip='*'" >>  ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.password='1qaz2wsx'" >>  ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.open_browser=False" >>  ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.port=80" >>  ~/.jupyter/jupyter_notebook_config.py

echo -e '{\n\t"NotebookApp": {\n\t "password":"sha1:7e4a0e17f315:b2b14ff2af0ee1cb4adc1ae01904eac538209d96"\n\t}\n}' > ~/.jupyter/jupyter_notebook_config.json
#3. make jupyter file directory
mkdir /var/jupyter

#3. start jupyter service
nohup jupyter notebook /var/jupyter --allow-root &
